<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta charset="utf-8">
</head>
<body>
	<div id='hello'>this is a div </div><br>
	<div>this is another div </div>
    <form action="">
        <input type='submit' name='sb'>
    </form>
	<script type="text/javascript">
		var d = document.getElementById("hello");
		d.innerHTML = "hello";
		d.onclick=function(e){
			var sb = document.getElementsByName("sb");
			sb[0].click();
		}

		var da = document.getElementsByTagName("div");
		for(var i = 0 ;i<da.length;i++){
			da[i].style.backgroundColor="red";
		}
	</script>

</body>
</html>